<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>添加商户</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
	<script src="__STATIC__/admin/js/address3.js"></script>
	<style>
		.layui-form-select{z-index: 9999}
		.map-search-res:hover{
			background-color: gray;
		}
		.layui-imgbox-close{width: 25px;height: 22px;right: -18px;top:-10px;}
		#picList .layui-imgbox .layui-imgbox-img{height: auto;}
		#picList .layui-imgbox{margin-right: 25px;height: auto}
	</style>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header">
					{if !$info['id']}<i class="fa fa-plus"></i> 添加商户{else}<i class="fa fa-pencil"></i> 编辑商户{/if}
					<i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i>
				</div>
				<div class="layui-card-body" pad15>
					{if $info['status']==2}<blockquote class="layui-elem-quote" style="color:red">商户未审核通过，驳回原因：{$info.reason}</blockquote>{/if}
					<div class="layui-form form-label-w8">
						<input type="hidden" name="info[id]" value="{$info.id}"/>
						<input type="hidden" name="uinfo[id]" value="{$uinfo['id']}">
						
						<div class="layui-form-item">
							<label class="layui-form-label">商户分类：</label>
							<div class="layui-input-inline" style="width:300px">
								<select name="info[cid]" xm-select="selectCid" xm-select-max="5" xm-select-search>
								<option value="">--请选择--</option>
								{foreach $clist as $cv}
									<option value="{$cv['id']}" {if in_array($cv['id'],$info['cid'])}selected{/if}>{$cv['name']}</option>
								{/foreach}
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"><span class="redstar">*</span>商户名称：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[name]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.name}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"><span class="redstar">*</span>登录账号：</label>
							<div class="layui-input-inline">
								<input type="text" name="uinfo[un]" value="{$uinfo['un']}" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">登录密码：</label>
							<div class="layui-input-inline">
								<input type="text" class="layui-input" autocomplete="off" name="uinfo[pwd]" value="" {if $uinfo['id']} placeholder="留空表示不修改密码"{else} lay-verify="required" lay-verType="tips"{/if}>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">抽成费率：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[feepercent]" class="layui-input" value="{$info.feepercent}">
							</div>
							<div class="layui-form-mid" style="margin-left:10px;">%，平台收取的佣金比例，如设置10%，平台抽成10%，商家得90%</div>
						</div>
						
						
						
						
						{if $set['wxfw_status'] == 1 || $set['wxfw_status'] == 2}
						<div class="layui-form-item">
							<label class="layui-form-label">子商户号收款：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="radio" name="info[wxpayst]" value="0" title="关闭" {if !$info['id'] || $info['wxpayst']==0}checked{/if} lay-filter="wxpayst"/>
								<input type="radio" name="info[wxpayst]" value="1" title="开启" {if $info['wxpayst']==1}checked{/if} lay-filter="wxpayst"/>
							</div>
							<div class="layui-form-mid layui-word-aux">开启后可设置子商户号独立收款结算，如开启扣除分销{:t('佣金')}则通过分账扣除（不能大于30%）</div>
						</div>
						<div class="layui-form-item" {if !$info['id'] || $info['wxpayst']==0}style="display:none"{/if} id="wxpayst_div">
							<label class="layui-form-label">子商户号：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[wxpay_submchid]" class="layui-input" value="{$info.wxpay_submchid}">
							</div>
							<div class="layui-form-mid" style="margin-left:10px;">在微信支付服务商后台申请的商户号</div>
						</div>
						{/if}
						
						
						<div class="layui-form-item">
							<label class="layui-form-label">联系人：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[linkman]" class="layui-input" value="{$info.linkman}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">联系电话：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[linktel]" class="layui-input" value="{$info.linktel}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">客服电话：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[tel]" class="layui-input" value="{$info.tel}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">客服链接：</label>
							<div class="layui-input-inline" style="width:300px">
								<input type="text" name="info[kfurl]" value="{$info.kfurl}" class="layui-input"/>
							</div>
							<div class="layui-form-mid layui-word-aux">商品详情页客服链接，不填写则使用商城内部客服系统</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">商家LOGO：</label>
							<input type="hidden" name="info[logo]" id="logo" lay-verType="tips" class="layui-input" value="{$info.logo}">
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="logo" upload-preview="logoPreview" onclick="uploader(this)">上传图片</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：640×640像素</div>
							<div id="logoPreview" class="picsList-class-padding">
								<div class="layui-imgbox" style="width:100px;">
									<div class="layui-imgbox-img"><a {if $info['logo']} style="display: block;" {else /} style="display: none;"  {/if}  class="layui-imgbox-close" href="javascript:void(0)" onclick="$(this).parent().find('img').attr('src','').hide();getpicsval('logo','logoPreview');$(this).hide();" title="删除"><i class="layui-icon layui-icon-close-fill-opaque"></i></a><img src="{$info.logo}"/></div>
								</div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">商家照片：</label>
							<input type="hidden" name="info[pics]" value="{$info['pics']}" id="pics">
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" onclick="uploader(this,true)" upload-input="pics" upload-preview="picList" >批量上传</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：600*340像素</div>
							<div id="picList" class="picsList-class-padding">
								{if $info['pics']}
								{php}$pics = explode(',',$info['pics']);{/php}
								{foreach $pics as $pic}
								<div class="layui-imgbox">
									<a class="layui-imgbox-close" href="javascript:void(0)" onclick="$(this).parent().remove();getpicsval('pics','picList')" title="删除"><i class="layui-icon layui-icon-close-fill-opaque"></i></a>
									<span class="layui-imgbox-img" style="height: auto;"><img src="{$pic}" onclick="previewImg('{$pic}')"></span>
								</div>
								{/foreach}{/if}
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">商家描述：</label>
							<div class="layui-input-inline" style="width:700px">
								<input type="text" name="info[desc]" class="layui-input" value="{$info.desc}">
							</div>
						</div>
						
						<!-- <div class="layui-form-item">
							<label class="layui-form-label">服务标签：</label>
							<div class="layui-input-inline" style="width:400px">
								<input type="text" name="info[fuwupoint]" class="layui-input" value="{$info.fuwupoint}">
							</div>
							<div class="layui-form-mid layui-word-aux">多个用空格隔开,如: 7天退换 48小时发货 假一赔十</div>
						</div> -->
						<div class="layui-form-item">
							<label class="layui-form-label">商家简介：</label>
							<div class="layui-input-inline" style="width:500px;">
								<script id="content" name="info[content]" type="text/plain" style="width:100%;height:500px">{$info.content}</script>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">商家地址：</label>
							<div style="display: flex;flex-direction: column;">
								<div class="areaDiv" style="margin-bottom: 8px">
									<div class="layui-input-inline" style="width: 150px">
										<select name="info[province]" id="province" lay-filter="province" {if !$info.id}lay-verify="required"{/if}></select>
									</div>
									<div class="layui-input-inline" style="width: 150px">
										<select name="info[city]" id="city" lay-filter="city"></select>
									</div>
									<div class="layui-input-inline" style="width: 150px" style="display:none">
										<!--							<select name="custom[form{$customeKey}][]" id="region{$customeKey}_area"></select>-->
										<select name="info[district]" id="district"></select>
									</div>
								</div>
								<div class="adressDiv">
								<div class="layui-input-inline" style="width:500px">
									<input type="text" id="address" name="info[address]" class="layui-input layui-input-search" value="{$info.address}">
									<div style="position: absolute;width: 500px;z-index: 100;" class="search-keywords">

									</div>
								</div>
								<button class="layui-btn layui-btn-primary" id="searchbtn">搜索</button>
								</div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"></label>
							<div id="l-map" style="width:600px;height:350px">地图加载中...</div>
							<div style="margin-left:160px;margin-top:10px">
								<div class="layui-input-inline" style="width:200px">
									<input type="text" name="info[longitude]" id="mapjd" class="layui-input" value="{$info.longitude|default='116.39782905578613'}"/>
								</div>
								<div class="layui-input-inline" style="width:200px">
									<input type="text" name="info[latitude]" id="mapwd" class="layui-input" value="{$info.latitude|default='39.90358020251377'}"/>
								</div>
							</div>
						</div>

						

						
						<div class="layui-form-item">
							<label class="layui-form-label">证明材料：</label>
							<input type="hidden" name="info[zhengming]" value="{$info['zhengming']}" id="zhengming">
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" onclick="uploader(this,true)" upload-input="zhengming" upload-preview="zhengmingList" >批量上传</button>
							<div id="zhengmingList" class="picsList-class-padding">
								{if $info['zhengming']}
								{php}$pics = explode(',',$info['zhengming']);{/php}
								{foreach $pics as $pic}
								<div class="layui-imgbox">
									<a class="layui-imgbox-close" href="javascript:void(0)" onclick="$(this).parent().remove();getpicsval('zhengming','zhengmingList')" title="删除"><i class="layui-icon layui-icon-close-fill-opaque"></i></a>
									<span class="layui-imgbox-img"><img src="{$pic}" onclick="previewImg('{$pic}')"></span>
								</div>
								{/foreach}{/if}
							</div>
						</div>
						
						
						<!-- <div class="layui-form-item">
							<label class="layui-form-label">微信号：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[weixin]" class="layui-input" value="{$info.weixin}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">支付宝：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[aliaccount]" class="layui-input" value="{$info.aliaccount}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">开户行：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[bankname]" class="layui-input" value="{$info.bankname}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">持卡人：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[bankcarduser]" class="layui-input" value="{$info.bankcarduser}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">银行卡号：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[bankcardnum]" class="layui-input" value="{$info.bankcardnum}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">消费人数：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[sales]" value="{$info.sales|default=0}" class="layui-input">
							</div>
						</div> -->
					

						{if getcustom('touzi_fenhong')}
							{if $admin['shareholder_status']}
							<div class="layui-form-item">
								<label class="layui-form-label">{:t('投资分红')}：</label>
								<div class="layui-input-inline">
									<input type="radio" name="info[shareholder_status]" value="1" title="开启" {if $info['shareholder_status']==1}checked{/if}>
									<input type="radio" name="info[shareholder_status]" value="0" title="关闭" {if !$info['shareholder_status'] || $info['shareholder_status']==0}checked{/if}>
								</div>
							</div>
							{/if}
						{/if}
						{if getcustom('member_gongxian')}
							{if $admin['member_gongxian_status']}
							<div class="layui-form-item">
								<label class="layui-form-label">{:t('贡献')}分红：</label>
								<div class="layui-input-inline">
									<input type="radio" name="info[fenhong_member_gongxian]" value="1" title="开启" {if $info['fenhong_member_gongxian']==1}checked{/if}>
									<input type="radio" name="info[fenhong_member_gongxian]" value="0" title="关闭" {if !$info['fenhong_member_gongxian'] || $info['fenhong_member_gongxian']==0}checked{/if}>
								</div>
							</div>
							{/if}
						{/if}
					{if getcustom('fenhong_business_item_switch')}
						{if $admin_auth_data=='all' || in_array('gdfenhong',$admin_auth_data)}
						<div class="layui-form-item">
							<label class="layui-form-label">{:t('股东分红')}：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[gdfenhong_status]" value="1" title="开启" {if $info['gdfenhong_status']==1}checked{/if}>
								<input type="radio" name="info[gdfenhong_status]" value="0" title="关闭" {if !$info['gdfenhong_status'] || $info['gdfenhong_status']==0}checked{/if}>
							</div>
						</div>
						{/if}
						{if $admin_auth_data=='all' || in_array('teamfenhong',$admin_auth_data)}
						<div class="layui-form-item">
							<label class="layui-form-label">{:t('团队分红')}：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[teamfenhong_status]" value="1" title="开启" {if $info['teamfenhong_status']==1}checked{/if}>
								<input type="radio" name="info[teamfenhong_status]" value="0" title="关闭" {if !$info['teamfenhong_status'] || $info['teamfenhong_status']==0}checked{/if}>
							</div>
						</div>
						{/if}
						{if $admin_auth_data=='all' || in_array('areafenhong',$admin_auth_data)}
						<div class="layui-form-item">
							<label class="layui-form-label">{:t('区域代理分红')}：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[areafenhong_status]" value="1" title="开启" {if $info['areafenhong_status']==1}checked{/if}>
								<input type="radio" name="info[areafenhong_status]" value="0" title="关闭" {if !$info['areafenhong_status'] || $info['areafenhong_status']==0}checked{/if}>
							</div>
						</div>
						{/if}
					{/if}
					{if $maidan_fenhong_new==1}
					<!--买单分红开关 start-->
					<div class="layui-form-item">
						<label class="layui-form-label">买单{:t('股东分红')}：</label>
						<div class="layui-input-inline">
							<input type="radio" name="info[maidan_gudong]" value="1" title="开启" {if $info['maidan_gudong']==1}checked{/if}>
							<input type="radio" name="info[maidan_gudong]" value="0" title="关闭" {if !$info['maidan_gudong'] || $info['maidan_gudong']==0}checked{/if}>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">买单{:t('区域代理分红')}：</label>
						<div class="layui-input-inline">
							<input type="radio" name="info[maidan_area]" value="1" title="开启" {if $info['maidan_area']==1}checked{/if}>
							<input type="radio" name="info[maidan_area]" value="0" title="关闭" {if !$info['maidan_area'] || $info['maidan_area']==0}checked{/if}>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">买单{:t('团队分红')}：</label>
						<div class="layui-input-inline">
							<input type="radio" name="info[maidan_team]" value="1" title="开启" {if $info['maidan_team']==1}checked{/if}>
							<input type="radio" name="info[maidan_team]" value="0" title="关闭" {if !$info['maidan_team'] || $info['maidan_team']==0}checked{/if}>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">买单{:t('团队分红见单')}：</label>
						<div class="layui-input-inline">
							<input type="radio" name="info[maidan_team_jiandan]" value="1" title="开启" {if $info['maidan_team_jiandan']==1}checked{/if}>
							<input type="radio" name="info[maidan_team_jiandan]" value="0" title="关闭" {if !$info['maidan_team_jiandan'] || $info['maidan_team_jiandan']==0}checked{/if}>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">买单{:t('投资分红')}：</label>
						<div class="layui-input-inline">
							<input type="radio" name="info[maidan_touzi]" value="1" title="开启" {if $info['maidan_touzi']==1}checked{/if}>
							<input type="radio" name="info[maidan_touzi]" value="0" title="关闭" {if !$info['maidan_touzi'] || $info['maidan_touzi']==0}checked{/if}>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">买单{:t('贡献值分红')}：</label>
						<div class="layui-input-inline">
							<input type="radio" name="info[maidan_gongxian]" value="1" title="开启" {if $info['maidan_gongxian']==1}checked{/if}>
							<input type="radio" name="info[maidan_gongxian]" value="0" title="关闭" {if !$info['maidan_gongxian'] || $info['maidan_gongxian']==0}checked{/if}>
						</div>
					</div>
					<!--买单分红开关 end-->
					{/if}


						{if getcustom('buybutton_custom')}
							{if $buybtn_status == 1}
							  <div class="layui-form-item">
								  <label class="layui-form-label">购买按钮自定义：</label>
								  <div class="layui-input-inline">
									  <input type="radio" name="info[buybtn_status]" value="1" title="开启" {if $info['buybtn_status']==1}checked{/if}>
									  <input type="radio" name="info[buybtn_status]" value="0" title="关闭" {if !$info['buybtn_status'] || $info['buybtn_status']==0}checked{/if}>
								  </div>
								  <div class="layui-form-mid layui-word-aux">开启后，商户可在商城商品编辑中自定义购买按钮</div>
							  </div>
						  	{/if}
						{/if}
					
					
					
					
					{if getcustom('yx_queue_free')}
					{if $admin_auth_data=='all' || in_array('QueueFreeSet/*',$admin_auth_data)}
					<div class="layui-form-item">
						<label class="layui-form-label">排队免单状态：</label>
						<div class="layui-input-inline">
							<input type="radio" name="free_set[status]" value="1" title="开启" {if $free_set['status']==1}checked{/if}>
							<input type="radio" name="free_set[status]" value="0" title="关闭" {if $free_set['status']==0}checked{/if}>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">单笔金额上限：</label>
						<div class="layui-input-inline" style="width:150px">
							<input type="text" name="free_set[money_max]" value="{$free_set['money_max']}" class="layui-input">
						</div>
						<div class="layui-form-mid">0为不限制，留空跟随系统设置</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">返利比例：</label>
						<div class="layui-input-inline" style="width:150px">
							<input type="number" name="free_set[rate_back]" value="{$free_set['rate_back']}" class="layui-input">
						</div>
						<div class="layui-form-mid">下单订单给排队订单的返利比例</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">修改免单比例：</label>
						<div class="layui-input-inline">
							<input type="radio" name="free_set[rate_status_business]" value="-1" title="跟随系统" {if $free_set['rate_status_business']=='-1'}checked{/if}>
							<input type="radio" name="free_set[rate_status_business]" value="1" title="开启" {if $free_set['rate_status_business']==1}checked{/if}>
							<input type="radio" name="free_set[rate_status_business]" value="0" title="关闭" {if $free_set['rate_status_business']==0}checked{/if}>
						</div>
						<div class="layui-form-mid">独立设置优先级大于系统设置</div>
					</div>
					{/if}
					{/if}
					<div class="layui-form-item" id="endtimediv">
						<label class="layui-form-label">到期时间：</label>
						<div class="layui-input-inline">
							<input type="text" id="endtime" name="info[endtime]" autocomplete="off" value="{if $info['endtime']}{:date('Y-m-d H:i:s',$info['endtime'])}{/if}" class="layui-input">
						</div>
					</div>
						<div class="layui-form-item">
							<label class="layui-form-label">状态：</label>
							<div class="layui-input-inline" style="width:380px">
								<input type="radio" name="info[status]" value="0" title="待审核" {if $info['id'] && $info['status']==0}checked{/if} lay-filter="changest">
								<input type="radio" name="info[status]" value="1" title="已通过" {if !$info['id'] || $info['status']==1}checked{/if} lay-filter="changest">
								<input type="radio" name="info[status]" value="2" title="已驳回" {if $info['id'] && $info['status']==2}checked{/if} lay-filter="changest">
								<input type="radio" name="info[status]" value="-1" title="已过期" {if $info['id'] && $info['status']==-1}checked{/if} lay-filter="changest">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">序号：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[sort]" value="{$info.sort|default=0}" class="layui-input">
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">用于排序,越大越靠前</div>
						</div>
						

						<div id="changestset" {if $info['status']!=2}style="display:none"{/if}>
							<div class="layui-form-item">
								<label class="layui-form-label">驳回原因：</label>
								<div class="layui-input-inline" style="width:310px">
									<input type="text" name="info[reason]" value="{$info['reason']}" class="layui-input"/>
								</div>
							</div>
						</div>
					  	
						
<!--						<div class="layui-form-item">-->
<!--							<label class="layui-form-label">模块权限：</label>-->
<!--							<div class="layui-input-inline">-->
<!--								<input type="radio" name="uinfo[auth_type]" value="1" title="所有" {if !$uinfo['id'] || $uinfo['auth_type']==1}checked{/if} lay-filter="auth_type">-->
<!--								<input type="radio" name="uinfo[auth_type]" value="0" title="选择" {if $uinfo['id'] && $uinfo['auth_type']==0}checked{/if} lay-filter="auth_type">-->
<!--							</div>-->
<!--						</div>-->
<!--						<div class="layui-form-item" id="authdataset" style="{if !$uinfo['id'] || $uinfo['auth_type']==1}display:none{/if}"></div>-->
		  					<input type="hidden" name="uinfo[auth_type]" value="0">
							{include file="public/user_auth"/}


						<div class="layui-form-item">
							<label class="layui-form-label"></label>
							<div class="layui-input-block">
								<button class="layui-btn layui-btn-danger" lay-submit lay-filter="formsubmit">提 交</button>
							</div>
						</div>
					</div>
				</div>
      </div>
    </div>
  </div>
	{include file="public/js"/}
  
  <script src="__STATIC__/admin/js/searchaddress.js"></script>
  <script>
	  address3('province','city','district',"{$info.province}","{$info.city}","{$info.district}");
  </script>
	<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=ABLBZ-4BIKU-GFTVB-BK7IK-OLQ35-QCBFF"></script>
	<script>

	layui.laydate.render({
		elem: '#endtime',
		type: 'datetime'
	});
	layui.form.on('radio(wxpayst)',function(data){
		if(data.value == '1'){
			$('#wxpayst_div').show();
		}else{
			$('#wxpayst_div').hide();
		}
	})

	layui.form.on('radio(auth_type)', function(data){
		if(data.value == '0'){
			$('#authdataset').show();
		}else{
			$('#authdataset').hide();
		}
	})
	layui.form.on('checkbox(checkall_all)',function(data){
		if(data.elem.checked){
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',true);
		}else{
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',false);
		}
		layui.form.render('checkbox'); 
	})
	layui.form.on('checkbox(checkall)',function(data){
		if(data.elem.checked){
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',true);
		}else{
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',false);
		}
		layui.form.render('checkbox'); 
	})
	layui.form.on('radio(changest)', function(data){
		if(data.value == '2'){
			$('#changestset').show();
		}else{
			$('#changestset').hide();
		}
	})
	var ueditor = UE.getEditor('content');
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		field['info[content]'] = ueditor.getContent();
		//console.log(field);return;
		var index = layer.load();
		$.post("{:url('save')}",field,function(data){
			layer.close(index);
			dialog(data.msg,data.status);
			if(data.status == 1){
				setTimeout(function(){
					parent.layer.close(parent.layer.getFrameIndex(window.name));
					parent.tableIns.reload()
				},1000)
			}
		})
	})
  </script>
	<script>
	
	var chooseUrlField = '';
	function chooseUrl2(field){
		chooseUrlField = field;
		layer.open({type:2,shadeClose:true,area:['1100px', '650px'],'title':'选择链接',content:"{:url('DesignerPage/chooseurl')}&callback=chooseLink2"})
	}
	function chooseLink2(urlname,url){
		$("#"+chooseUrlField).val(url);
	}

	function previewImg(url){
		layer.open({type:1,area:'500px',content:'<div style="margin:auto auto;text-align:center"><img src="'+url+'" style="max-width:100%;max-height:100%"/></div>',title:false,shadeClose:true})
	}
	// 地图详细地址框按回车键搜索
	$(".layui-input-search").keydown(function (e) {
		if (e.which == 13) {
				//拼接省市县
				var address = $('#province').val() + $('#city').val() + $('#district').val() + $("#address").val();
				if(address == ""){
					dialog("请输地址！");
					return ;
				}
				clearOverlays(markers);
				//根据输入的关键字在搜索范围内检索
				searchService.search(address);
		}
	});
	
	</script>
</body>
</html>